<template>
    <aside class="aside">
        <h3 class="saide-header">火柴盒</h3>
        <ul class="saide-link-list">
            <li>首页</li>
            <li>首页</li>
            <li>首页</li>
            <li>首页</li>
        </ul>
        <ul class="saide-tag-list">
            <li
                v-for="item in tagList"
                :key="item['id']"
                @click="resetPageingGetArticleListFn(item['id'])"
            >{{ item['name'] }}</li>
        </ul>
    </aside>
</template>

<script>
// import { onMounted } from 'vue'
import tagFn from '@/use/home/tagList'
import articleListFn from '@/use/home/articleList'


export default {
    name: '',
    setup() {
        
        // 获取标签列表
        const { tagList, getTabListFn } = tagFn()
        getTabListFn()

        // 点击标签 获取文章列表
        const { resetPageingGetArticleListFn } = articleListFn()

        return {
            tagList, getTabListFn, resetPageingGetArticleListFn
        }
    },
}
</script>

<style scoped>
.aside {
    padding: 0 20px;
    width: 300px;
}
.saide-header {
    padding: 30px 0;
    background-color: #222;
    color: #fff;
    font-size: 26px;
    text-align: center;
    font-weight: 400;
}
.saide-link-list {
    margin-top: 10px;
}
.saide-link-list > li {
    padding: 10px;
    font-size: 14px;
    color: #333;

    transition: background-color 0.3s;
}
.saide-link-list > li:hover {
    background-color: #999;
    cursor: pointer;
}

.saide-tag-list {
    margin-top: 30px;
}
.saide-tag-list > li {
    display: inline-block;
    margin: 5px 5px 10px;
    padding: 10px;
    font-size: 12px;
    color: #333;

    transition: transform 0.3s;
}
.saide-tag-list > li:hover {
    cursor: pointer;
    transform: scale(1.4);
    /* background-color: #999; */
}
</style>
